﻿
/*----------------------------------------------------------------//
// 文件名：MoContractgb.cs
// 文件功能描述：实体 MoContractgb.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoContractgb
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoContractgb
	/// </summary>
	public partial class MoContractgb:ICloneable
	{
		#region 表Contractgb的字段
		private string _gb_code;
		private string _report_id;
		#endregion
		
		#region 构造函数
		public MoContractgb()
		{
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoContractgb(MoContractgb item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoContractgb(string gb_code,string report_id)
		{
		this._gb_code=gb_code;
		this._report_id=report_id;
		}
		#endregion
		
		#region 表Contractgb的字段属性
		/// <summary>
		/// GB_CODE
		/// </summary>
		public string Gb_Code
		{
			get {return _gb_code;}
			set {_gb_code=value;}
		}
		/// <summary>
		///编号规则为NO. LDYYMMXXX，其中NO.LD为固定前缀，YY表示年份，MM代表月份，XXX代表当月第几个报告。XXX为业务组手工录入。此编号不能重复。报告编号做为唯一值编号贯穿于整个系统流程（包括财务、业务、试验、报告等各部门）
		/// </summary>
		public string Report_Id
		{
			get {return _report_id;}
			set {_report_id=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoContractgb CopyTo(MoContractgb item)
        {
		    item.Gb_Code=this.Gb_Code;
		    item.Report_Id=this.Report_Id;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoContractgb NewContractgb=new MoContractgb();
		    NewContractgb._gb_code=this._gb_code;
		    NewContractgb._report_id=this._report_id;
			return NewContractgb;
		}
		
		private static MoContractgb _empty = new MoContractgb(string.Empty,string.Empty);
        public static MoContractgb Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoContractgb NewContractgb = obj as MoContractgb;
                if (NewContractgb == null)
                {
                    return false;
                }
                else
                {
				if (NewContractgb.Gb_Code==this.Gb_Code && NewContractgb.Report_Id==this.Report_Id)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Gb_Code={0}/Report_Id={1}",_gb_code,_report_id);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["GB_Code"]!=null && row["GB_Code"]!=DBNull.Value)
			{
			    this.Gb_Code = (string)row["GB_Code"];
			}
			else
			{
				this.Gb_Code =string.Empty;
			}
		    if(row["Report_ID"]!=null && row["Report_ID"]!=DBNull.Value)
			{
			    this.Report_Id = (string)row["Report_ID"];
			}
			else
			{
				this.Report_Id =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["GB_Code"] = this.Gb_Code;
			row["Report_ID"] = this.Report_Id;
		}
		#endregion
	}
}
#endregion
